package com.big.app.controller;

import com.big.app.service.FoodOrderService;
import com.big.app.service.FoodsService;
import com.big.app.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/api/foods/")
@CrossOrigin
@RestController
@Api(value = "美食订单接口", tags = "美食订单接口")
public class FoodOrderController {
    @Autowired
    private FoodOrderService service;

    @GetMapping("order.do")
    @ApiOperation(value = "生成订单")
    public R order(@Param("name") String name,@Param("price") double price){
        return service.foodOrder(name, price);
    }

}
